﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using DataTier;
using DataTier.Entities;

namespace DataServices
{
    [ServiceContract(Namespace = WCFSettings.Namespace)]
    [XmlSerializerFormat]
    public interface IDictionariesService
    {
        /// <summary>
        /// Возвращает список Компаний
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<Company> GetCompanyList(int currentUserId);


        /// <summary>
        /// Возвращается список Центров Затрат
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<CostsCenterEntity> GetCostsCenterList(int currentUserId);


        /// <summary>
        /// Возвращается список Центров затрат со связанной с ними информацией о пользователе и правах доступа
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<CostsCenterFullInfoEntity> GetCostsCenterFullInfoList(int currentUserId);


        /// <summary>
        /// Возвращается Центр затрат со связанной с ними информацией о пользователе и правах доступа
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        CostsCenterFullInfoEntity GetCostsCenterFullInfo(int currentUserId, int CostsCenterId);


        /// <summary>
        /// Возвращается Центр затрат со связанной с ними информацией о пользователе и правах доступа
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        CostsCenterFullInfoEntity GetCostsCenterFullInfoByUserId(int currentUserId, int UserId);



        /// <summary>
        /// Сохранение Центра затрат и информации о пользователе и его правах
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="juridicalPerson"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        int SaveCostsCenterFullInfoEntity(int currentUserId, CostsCenterFullInfoEntity center);


        /// <summary>
        /// Возвращает список отделов
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<DepartmentEntity> GetDepartmentList(int currentUserId);


        /// <summary>
        /// Сохранение Отдела
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="department"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        int SaveDepartment(int currentUserId, DepartmentEntity department);
        

        /// <summary>
        /// Возвращает список Юридических лиц
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<JuridicalPersonEntity> GetJuridicalPersonList(int currentUserId);


        /// <summary>
        /// Сохранение Юридического лица
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="juridicalPerson"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        int SaveJuridicalPerson(int currentUserId, JuridicalPersonEntity juridicalPerson);


        /// <summary>
        /// Удаление Центра затрат
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="CostsCenterId"></param>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        void DeleteCostsCenter(int currentUserId, int CostsCenterId);


        /// <summary>
        /// Возвращает список Ролей
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<RoleEntity> GetRoleEntityList(int currentUserId);


        /// <summary>
        /// Возвращает список Ролей
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<Role> GetRoleList(int currentUserId);


        /// <summary>
        /// Возвращает Роль
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="roleId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        RoleEntity GetRoleEntity(int currentUserId, int roleId);


        /// <summary>
        /// Возвращает список пунктов Меню
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<Menu> GetMenuList(int currentUserId);


        /// <summary>
        /// Возвращает список Статусов документов
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<State> GetStateList(int currentUserId);


        /// <summary>
        /// Возвращает список Страниц системы
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        List<WebPage> GetWebPageList(int currentUserId);


        /// <summary>
        /// Сохранение Роли со всеми правами доступа
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="role"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        int SaveRoleEntity(int currentUserId, RoleEntity role);


        /// <summary>
        /// Удаление Роли
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="RoleId"></param>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        void DeleteRole(int currentUserId, int RoleId);


        /// <summary>
        /// Удаление Юридического лица
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="RoleId"></param>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        void DeleteJuridicalPerson(int currentUserId, int juridicalPersonId);


        /// <summary>
        /// Удаление Отдела
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="departmentId"></param>
        [OperationContract]
        [FaultContract(typeof(ExceptionDetail))]
        void DeleteDepartment(int currentUserId, int departmentId);


    }
}
